package net.entelijan.cobean.examples.showcase.table;

import java.util.ArrayList;
import java.util.List;

import net.entelijan.cobean.core.ColumnDesc;
import net.entelijan.cobean.core.IMultiSelectionListCobean;
import net.entelijan.cobean.core.SelectionMode;
import net.entelijan.cobean.examples.showcase.CobeanExamplesTestUtil;
import net.entelijan.cobean.examples.showcase.ShowcaseTestFrame;
import net.entelijan.cobean.examples.util.NestedBean;
import net.entelijan.cobean.examples.util.ExamplesUtil;
import net.entelijan.cobean.table.DefaultTableInitializer;
import net.entelijan.cobean.util.DateComparator;
import net.entelijan.cobean.util.DateConverter;
import net.entelijan.cobean.util.NumberComparator;

import org.fest.swing.data.TableCell;
import org.fest.swing.fixture.FrameFixture;
import org.fest.swing.fixture.JTableFixture;
import org.junit.Test;

@SuppressWarnings("unused")
public class SortTableFestTestCase {

	@Test
	public void test() {
		SortTablePanel panel = new SortTablePanel();
		ShowcaseTestFrame frame = new ShowcaseTestFrame(panel);
		FrameFixture showcaseFix = new FrameFixture(frame);
		try {
			showcaseFix.show();

			DefaultTableInitializer<NestedBean> initializer = new DefaultTableInitializer<NestedBean>();
			initializer.setCoTable(panel.getTable());
			List<ColumnDesc> colDescs = createColumnDescriptions();
			initializer.setColumnDescs(colDescs);
			initializer.setSelectionMode(SelectionMode.SINGLE);
			final IMultiSelectionListCobean<NestedBean> cobean = initializer
					.initialize();
			List<NestedBean> data = ExamplesUtil.createNestedBeansLocales();
			cobean.setValue(data);

			JTableFixture table = showcaseFix.table("SortTablePanel.table");
			{
				table.requireContents(getNestedBeansLocaleContetUnsorted());
				table.selectCell(TableCell.row(2).column(0));
				pauseShort();
				NestedBean selBean = cobean.getSelectedValue().get(0);
				CobeanExamplesTestUtil.assertObjectValue(data.get(2), selBean,
						colDescs, 0);
				pauseShort();
				// Not yet implementsd
				// cobean.setselectedValue(data.get(5));
				// pauseLong();
			}
			{
				pauseShort();
				table.tableHeader().clickColumn(0);
				pauseMedium();
				table.tableHeader().clickColumn(0);
				table
						.requireContents(getNestedBeansLocaleContetSortedByColumn0());
				CobeanExamplesTestUtil.assertListContent(
						getNestedBeansLocaleContetUnsorted(),
						cobean.getValue(), colDescs);
				table.selectCell(TableCell.row(3).column(0));
				pauseShort();
				NestedBean selBean = cobean.getSelectedValue().get(0);
				CobeanExamplesTestUtil.assertObjectValue(data.get(105),
						selBean, colDescs, 0);
				pauseShort();
			}
			{
				table.tableHeader().clickColumn(2);
				table
						.requireContents(getNestedBeansLocaleContetSortedByColumn2());
				CobeanExamplesTestUtil.assertListContent(
						getNestedBeansLocaleContetUnsorted(),
						cobean.getValue(), colDescs);
				NestedBean selBean = cobean.getSelectedValue().get(0);
				CobeanExamplesTestUtil.assertObjectValue(data.get(105),
						selBean, colDescs, 0);
			}

		} finally {
			showcaseFix.cleanUp();
		}
	}

	private List<ColumnDesc> createColumnDescriptions() {
		List<ColumnDesc> colDescs = new ArrayList<ColumnDesc>();
		{
			ColumnDesc colDesc = new ColumnDesc();
			colDesc.setPropertyName("intVal");
			colDesc.setHeaderName("Number(sortable as number)");
			colDesc.setSortable(true);
			colDesc.setComparator(new NumberComparator());
			colDescs.add(colDesc);
		}
		{
			ColumnDesc colDesc = new ColumnDesc();
			colDesc.setPropertyName("intVal");
			colDesc.setHeaderName("Number(sortable as string)");
			colDesc.setSortable(true);
			colDescs.add(colDesc);
		}
		{
			ColumnDesc colDesc = new ColumnDesc();
			colDesc.setPropertyName("stringVal");
			colDesc.setHeaderName("Locale(sortable)");
			colDesc.setSortable(true);
			colDescs.add(colDesc);
		}
		{
			ColumnDesc colDesc = new ColumnDesc();
			colDesc.setPropertyName("dateVal");
			colDesc.setHeaderName("Dummy Date(sortable)");
			colDesc.setSortable(true);
			colDesc.setComparator(new DateComparator());
			colDesc.setConverter(new DateConverter("yyyy-MM-dd HH:mm"));
			colDescs.add(colDesc);
		}
		return colDescs;
	}

	private String[][] getNestedBeansLocaleContetSortedByColumn2() {
		return new String[][] {
				{ "8", "8", "Albania-Albanian", "2009-08-13 10:23" },
				{ "81", "81", "Algeria-Arabic", "2009-08-10 12:34" },
				{ "100", "100", "Argentina-Spanish", "2009-08-23 12:08" },
				{ "76", "76", "Australia-English", "2009-08-09 19:22" },
				{ "52", "52", "Austria-German", "2009-08-12 13:37" },
				{ "49", "49", "Bahrain-Arabic", "2009-08-22 01:27" },
				{ "86", "86", "Belarus-Belarusian", "2009-08-20 08:51" },
				{ "71", "71", "Belgium-Dutch", "2009-08-12 10:56" },
				{ "30", "30", "Belgium-French", "2009-08-24 19:00" },
				{ "75", "75", "Bolivia-Spanish", "2009-08-17 12:35" },
				{ "4", "4", "Bosnia and Herzegovina-Serbian",
						"2009-08-28 06:50" },
				{ "43", "43", "Brazil-Portuguese", "2009-08-11 14:03" },
				{ "89", "89", "Bulgaria-Bulgarian", "2009-08-30 05:20" },
				{ "97", "97", "Canada-English", "2009-08-26 14:55" },
				{ "33", "33", "Canada-French", "2009-08-18 08:10" },
				{ "60", "60", "Chile-Spanish", "2009-08-11 10:57" },
				{ "85", "85", "China-Chinese", "2009-08-24 16:43" },
				{ "58", "58", "Colombia-Spanish", "2009-08-13 08:05" },
				{ "59", "59", "Costa Rica-Spanish", "2009-08-11 14:07" },
				{ "102", "102", "Croatia-Croatian", "2009-08-10 15:30" },
				{ "12", "12", "Cyprus-Greek", "2009-08-18 17:10" },
				{ "93", "93", "Czech Republic-Czech", "2009-08-24 06:20" },
				{ "107", "107", "Denmark-Danish", "2009-08-26 15:17" },
				{ "45", "45", "Dominican Republic-Spanish", "2009-08-23 13:22" },
				{ "54", "54", "Ecuador-Spanish", "2009-08-28 17:01" },
				{ "61", "61", "Egypt-Arabic", "2009-08-20 08:36" },
				{ "78", "78", "El Salvador-Spanish", "2009-08-12 06:51" },
				{ "34", "34", "Estonia-Estonian", "2009-08-16 07:11" },
				{ "17", "17", "Finland-Finnish", "2009-08-30 16:30" },
				{ "92", "92", "France-French", "2009-08-07 15:00" },
				{ "98", "98", "Germany-German", "2009-08-24 19:20" },
				{ "64", "64", "Greece-Greek", "2009-08-10 03:08" },
				{ "5", "5", "Guatemala-Spanish", "2009-08-08 12:21" },
				{ "108", "108", "Honduras-Spanish", "2009-08-18 02:51" },
				{ "87", "87", "Hong Kong-Chinese", "2009-08-11 20:16" },
				{ "66", "66", "Hungary-Hungarian", "2009-08-22 06:45" },
				{ "57", "57", "Iceland-Icelandic", "2009-08-13 03:55" },
				{ "72", "72", "India-English", "2009-08-22 09:57" },
				{ "47", "47", "India-Hindi", "2009-08-31 13:13" },
				{ "40", "40", "Indonesia-Indonesian", "2009-08-10 03:11" },
				{ "9", "9", "Iraq-Arabic", "2009-08-08 10:58" },
				{ "67", "67", "Ireland-English", "2009-08-10 10:12" },
				{ "29", "29", "Ireland-Irish", "2009-08-14 14:30" },
				{ "88", "88", "Israel-Hebrew", "2009-08-27 13:58" },
				{ "65", "65", "Italy-Italian", "2009-08-07 17:09" },
				{ "2", "2", "Japan-Japanese", "2009-08-30 18:26" },
				{ "0", "0", "Japan-Japanese", "2009-08-16 13:42" },
				{ "56", "56", "Jordan-Arabic", "2009-08-17 11:19" },
				{ "35", "35", "Kuwait-Arabic", "2009-08-30 18:51" },
				{ "42", "42", "Latvia-Latvian", "2009-08-31 01:13" },
				{ "32", "32", "Lebanon-Arabic", "2009-08-30 08:26" },
				{ "84", "84", "Libya-Arabic", "2009-08-19 12:06" },
				{ "27", "27", "Lithuania-Lithuanian", "2009-08-25 22:38" },
				{ "70", "70", "Luxembourg-French", "2009-08-19 21:33" },
				{ "99", "99", "Luxembourg-German", "2009-08-11 11:30" },
				{ "14", "14", "Macedonia-Macedonian", "2009-08-23 10:33" },
				{ "101", "101", "Malaysia-Malay", "2009-08-09 12:11" },
				{ "18", "18", "Malta-English", "2009-08-26 16:33" },
				{ "90", "90", "Malta-Maltese", "2009-08-19 14:12" },
				{ "38", "38", "Mexico-Spanish", "2009-08-21 09:12" },
				{ "83", "83", "Montenegro-Serbian", "2009-08-24 19:10" },
				{ "74", "74", "Morocco-Arabic", "2009-08-30 05:38" },
				{ "53", "53", "Netherlands-Dutch", "2009-08-19 12:37" },
				{ "25", "25", "New Zealand-English", "2009-08-16 00:26" },
				{ "28", "28", "Nicaragua-Spanish", "2009-08-15 20:17" },
				{ "26", "26", "Norway-Norwegian", "2009-08-19 10:58" },
				{ "7", "7", "Norway-Norwegian", "2009-08-10 16:15" },
				{ "104", "104", "Oman-Arabic", "2009-08-08 10:38" },
				{ "3", "3", "Panama-Spanish", "2009-08-30 08:58" },
				{ "91", "91", "Paraguay-Spanish", "2009-08-27 18:56" },
				{ "1", "1", "Peru-Spanish", "2009-08-20 08:01" },
				{ "50", "50", "Philippines-English", "2009-08-08 18:07" },
				{ "69", "69", "Poland-Polish", "2009-08-11 08:13" },
				{ "11", "11", "Portugal-Portuguese", "2009-09-01 03:17" },
				{ "96", "96", "Puerto Rico-Spanish", "2009-08-22 02:46" },
				{ "13", "13", "Qatar-Arabic", "2009-08-30 07:01" },
				{ "95", "95", "Romania-Romanian", "2009-08-24 21:44" },
				{ "79", "79", "Russia-Russian", "2009-09-01 09:22" },
				{ "22", "22", "Saudi Arabia-Arabic", "2009-08-09 05:00" },
				{ "24", "24", "Serbia and Montenegro-Serbian",
						"2009-08-27 17:12" },
				{ "36", "36", "Serbia-Serbian", "2009-08-09 19:43" },
				{ "77", "77", "Singapore-Chinese", "2009-08-16 00:43" },
				{ "103", "103", "Singapore-English", "2009-08-26 06:37" },
				{ "20", "20", "Slovakia-Slovak", "2009-08-31 01:38" },
				{ "19", "19", "Slovenia-Slovenian", "2009-08-14 02:34" },
				{ "62", "62", "South Africa-English", "2009-08-09 05:38" },
				{ "80", "80", "South Korea-Korean", "2009-08-20 16:05" },
				{ "73", "73", "Spain-Catalan", "2009-08-28 07:09" },
				{ "31", "31", "Spain-Spanish", "2009-08-23 16:44" },
				{ "39", "39", "Sudan-Arabic", "2009-08-18 16:52" },
				{ "106", "106", "Sweden-Swedish", "2009-08-28 01:53" },
				{ "46", "46", "Switzerland-French", "2009-08-13 21:07" },
				{ "15", "15", "Switzerland-German", "2009-08-10 10:50" },
				{ "94", "94", "Switzerland-Italian", "2009-08-22 17:21" },
				{ "44", "44", "Syria-Arabic", "2009-08-12 09:43" },
				{ "55", "55", "Taiwan-Chinese", "2009-08-17 06:41" },
				{ "105", "105", "Thailand-Thai", "2009-08-28 22:47" },
				{ "63", "63", "Thailand-Thai", "2009-08-20 10:29" },
				{ "51", "51", "Tunisia-Arabic", "2009-08-09 02:28" },
				{ "21", "21", "Turkey-Turkish", "2009-08-11 04:16" },
				{ "68", "68", "Ukraine-Ukrainian", "2009-08-16 23:14" },
				{ "6", "6", "United Arab Emirates-Arabic", "2009-08-15 16:38" },
				{ "23", "23", "United Kingdom-English", "2009-08-21 22:46" },
				{ "16", "16", "United States-English", "2009-08-11 12:18" },
				{ "37", "37", "United States-Spanish", "2009-08-29 17:33" },
				{ "41", "41", "Uruguay-Spanish", "2009-08-28 01:19" },
				{ "48", "48", "Venezuela-Spanish", "2009-08-24 21:06" },
				{ "82", "82", "Vietnam-Vietnamese", "2009-08-31 11:44" },
				{ "10", "10", "Yemen-Arabic", "2009-08-16 06:08" }

		};
	}

	private String[][] getNestedBeansLocaleContetSortedByColumn0() {
		return new String[][] {
				{ "108", "108", "Honduras-Spanish", "2009-08-18 02:51" },
				{ "107", "107", "Denmark-Danish", "2009-08-26 15:17" },
				{ "106", "106", "Sweden-Swedish", "2009-08-28 01:53" },
				{ "105", "105", "Thailand-Thai", "2009-08-28 22:47" },
				{ "104", "104", "Oman-Arabic", "2009-08-08 10:38" },
				{ "103", "103", "Singapore-English", "2009-08-26 06:37" },
				{ "102", "102", "Croatia-Croatian", "2009-08-10 15:30" },
				{ "101", "101", "Malaysia-Malay", "2009-08-09 12:11" },
				{ "100", "100", "Argentina-Spanish", "2009-08-23 12:08" },
				{ "99", "99", "Luxembourg-German", "2009-08-11 11:30" },
				{ "98", "98", "Germany-German", "2009-08-24 19:20" },
				{ "97", "97", "Canada-English", "2009-08-26 14:55" },
				{ "96", "96", "Puerto Rico-Spanish", "2009-08-22 02:46" },
				{ "95", "95", "Romania-Romanian", "2009-08-24 21:44" },
				{ "94", "94", "Switzerland-Italian", "2009-08-22 17:21" },
				{ "93", "93", "Czech Republic-Czech", "2009-08-24 06:20" },
				{ "92", "92", "France-French", "2009-08-07 15:00" },
				{ "91", "91", "Paraguay-Spanish", "2009-08-27 18:56" },
				{ "90", "90", "Malta-Maltese", "2009-08-19 14:12" },
				{ "89", "89", "Bulgaria-Bulgarian", "2009-08-30 05:20" },
				{ "88", "88", "Israel-Hebrew", "2009-08-27 13:58" },
				{ "87", "87", "Hong Kong-Chinese", "2009-08-11 20:16" },
				{ "86", "86", "Belarus-Belarusian", "2009-08-20 08:51" },
				{ "85", "85", "China-Chinese", "2009-08-24 16:43" },
				{ "84", "84", "Libya-Arabic", "2009-08-19 12:06" },
				{ "83", "83", "Montenegro-Serbian", "2009-08-24 19:10" },
				{ "82", "82", "Vietnam-Vietnamese", "2009-08-31 11:44" },
				{ "81", "81", "Algeria-Arabic", "2009-08-10 12:34" },
				{ "80", "80", "South Korea-Korean", "2009-08-20 16:05" },
				{ "79", "79", "Russia-Russian", "2009-09-01 09:22" },
				{ "78", "78", "El Salvador-Spanish", "2009-08-12 06:51" },
				{ "77", "77", "Singapore-Chinese", "2009-08-16 00:43" },
				{ "76", "76", "Australia-English", "2009-08-09 19:22" },
				{ "75", "75", "Bolivia-Spanish", "2009-08-17 12:35" },
				{ "74", "74", "Morocco-Arabic", "2009-08-30 05:38" },
				{ "73", "73", "Spain-Catalan", "2009-08-28 07:09" },
				{ "72", "72", "India-English", "2009-08-22 09:57" },
				{ "71", "71", "Belgium-Dutch", "2009-08-12 10:56" },
				{ "70", "70", "Luxembourg-French", "2009-08-19 21:33" },
				{ "69", "69", "Poland-Polish", "2009-08-11 08:13" },
				{ "68", "68", "Ukraine-Ukrainian", "2009-08-16 23:14" },
				{ "67", "67", "Ireland-English", "2009-08-10 10:12" },
				{ "66", "66", "Hungary-Hungarian", "2009-08-22 06:45" },
				{ "65", "65", "Italy-Italian", "2009-08-07 17:09" },
				{ "64", "64", "Greece-Greek", "2009-08-10 03:08" },
				{ "63", "63", "Thailand-Thai", "2009-08-20 10:29" },
				{ "62", "62", "South Africa-English", "2009-08-09 05:38" },
				{ "61", "61", "Egypt-Arabic", "2009-08-20 08:36" },
				{ "60", "60", "Chile-Spanish", "2009-08-11 10:57" },
				{ "59", "59", "Costa Rica-Spanish", "2009-08-11 14:07" },
				{ "58", "58", "Colombia-Spanish", "2009-08-13 08:05" },
				{ "57", "57", "Iceland-Icelandic", "2009-08-13 03:55" },
				{ "56", "56", "Jordan-Arabic", "2009-08-17 11:19" },
				{ "55", "55", "Taiwan-Chinese", "2009-08-17 06:41" },
				{ "54", "54", "Ecuador-Spanish", "2009-08-28 17:01" },
				{ "53", "53", "Netherlands-Dutch", "2009-08-19 12:37" },
				{ "52", "52", "Austria-German", "2009-08-12 13:37" },
				{ "51", "51", "Tunisia-Arabic", "2009-08-09 02:28" },
				{ "50", "50", "Philippines-English", "2009-08-08 18:07" },
				{ "49", "49", "Bahrain-Arabic", "2009-08-22 01:27" },
				{ "48", "48", "Venezuela-Spanish", "2009-08-24 21:06" },
				{ "47", "47", "India-Hindi", "2009-08-31 13:13" },
				{ "46", "46", "Switzerland-French", "2009-08-13 21:07" },
				{ "45", "45", "Dominican Republic-Spanish", "2009-08-23 13:22" },
				{ "44", "44", "Syria-Arabic", "2009-08-12 09:43" },
				{ "43", "43", "Brazil-Portuguese", "2009-08-11 14:03" },
				{ "42", "42", "Latvia-Latvian", "2009-08-31 01:13" },
				{ "41", "41", "Uruguay-Spanish", "2009-08-28 01:19" },
				{ "40", "40", "Indonesia-Indonesian", "2009-08-10 03:11" },
				{ "39", "39", "Sudan-Arabic", "2009-08-18 16:52" },
				{ "38", "38", "Mexico-Spanish", "2009-08-21 09:12" },
				{ "37", "37", "United States-Spanish", "2009-08-29 17:33" },
				{ "36", "36", "Serbia-Serbian", "2009-08-09 19:43" },
				{ "35", "35", "Kuwait-Arabic", "2009-08-30 18:51" },
				{ "34", "34", "Estonia-Estonian", "2009-08-16 07:11" },
				{ "33", "33", "Canada-French", "2009-08-18 08:10" },
				{ "32", "32", "Lebanon-Arabic", "2009-08-30 08:26" },
				{ "31", "31", "Spain-Spanish", "2009-08-23 16:44" },
				{ "30", "30", "Belgium-French", "2009-08-24 19:00" },
				{ "29", "29", "Ireland-Irish", "2009-08-14 14:30" },
				{ "28", "28", "Nicaragua-Spanish", "2009-08-15 20:17" },
				{ "27", "27", "Lithuania-Lithuanian", "2009-08-25 22:38" },
				{ "26", "26", "Norway-Norwegian", "2009-08-19 10:58" },
				{ "25", "25", "New Zealand-English", "2009-08-16 00:26" },
				{ "24", "24", "Serbia and Montenegro-Serbian",
						"2009-08-27 17:12" },
				{ "23", "23", "United Kingdom-English", "2009-08-21 22:46" },
				{ "22", "22", "Saudi Arabia-Arabic", "2009-08-09 05:00" },
				{ "21", "21", "Turkey-Turkish", "2009-08-11 04:16" },
				{ "20", "20", "Slovakia-Slovak", "2009-08-31 01:38" },
				{ "19", "19", "Slovenia-Slovenian", "2009-08-14 02:34" },
				{ "18", "18", "Malta-English", "2009-08-26 16:33" },
				{ "17", "17", "Finland-Finnish", "2009-08-30 16:30" },
				{ "16", "16", "United States-English", "2009-08-11 12:18" },
				{ "15", "15", "Switzerland-German", "2009-08-10 10:50" },
				{ "14", "14", "Macedonia-Macedonian", "2009-08-23 10:33" },
				{ "13", "13", "Qatar-Arabic", "2009-08-30 07:01" },
				{ "12", "12", "Cyprus-Greek", "2009-08-18 17:10" },
				{ "11", "11", "Portugal-Portuguese", "2009-09-01 03:17" },
				{ "10", "10", "Yemen-Arabic", "2009-08-16 06:08" },
				{ "9", "9", "Iraq-Arabic", "2009-08-08 10:58" },
				{ "8", "8", "Albania-Albanian", "2009-08-13 10:23" },
				{ "7", "7", "Norway-Norwegian", "2009-08-10 16:15" },
				{ "6", "6", "United Arab Emirates-Arabic", "2009-08-15 16:38" },
				{ "5", "5", "Guatemala-Spanish", "2009-08-08 12:21" },
				{ "4", "4", "Bosnia and Herzegovina-Serbian",
						"2009-08-28 06:50" },
				{ "3", "3", "Panama-Spanish", "2009-08-30 08:58" },
				{ "2", "2", "Japan-Japanese", "2009-08-30 18:26" },
				{ "1", "1", "Peru-Spanish", "2009-08-20 08:01" },
				{ "0", "0", "Japan-Japanese", "2009-08-16 13:42" }

		};
	}

	private String[][] getNestedBeansLocaleContetUnsorted() {
		return new String[][] {
				{ "0", "0", "Japan-Japanese", "2009-08-16 13:42" },
				{ "1", "1", "Peru-Spanish", "2009-08-20 08:01" },
				{ "2", "2", "Japan-Japanese", "2009-08-30 18:26" },
				{ "3", "3", "Panama-Spanish", "2009-08-30 08:58" },
				{ "4", "4", "Bosnia and Herzegovina-Serbian",
						"2009-08-28 06:50" },
				{ "5", "5", "Guatemala-Spanish", "2009-08-08 12:21" },
				{ "6", "6", "United Arab Emirates-Arabic", "2009-08-15 16:38" },
				{ "7", "7", "Norway-Norwegian", "2009-08-10 16:15" },
				{ "8", "8", "Albania-Albanian", "2009-08-13 10:23" },
				{ "9", "9", "Iraq-Arabic", "2009-08-08 10:58" },
				{ "10", "10", "Yemen-Arabic", "2009-08-16 06:08" },
				{ "11", "11", "Portugal-Portuguese", "2009-09-01 03:17" },
				{ "12", "12", "Cyprus-Greek", "2009-08-18 17:10" },
				{ "13", "13", "Qatar-Arabic", "2009-08-30 07:01" },
				{ "14", "14", "Macedonia-Macedonian", "2009-08-23 10:33" },
				{ "15", "15", "Switzerland-German", "2009-08-10 10:50" },
				{ "16", "16", "United States-English", "2009-08-11 12:18" },
				{ "17", "17", "Finland-Finnish", "2009-08-30 16:30" },
				{ "18", "18", "Malta-English", "2009-08-26 16:33" },
				{ "19", "19", "Slovenia-Slovenian", "2009-08-14 02:34" },
				{ "20", "20", "Slovakia-Slovak", "2009-08-31 01:38" },
				{ "21", "21", "Turkey-Turkish", "2009-08-11 04:16" },
				{ "22", "22", "Saudi Arabia-Arabic", "2009-08-09 05:00" },
				{ "23", "23", "United Kingdom-English", "2009-08-21 22:46" },
				{ "24", "24", "Serbia and Montenegro-Serbian",
						"2009-08-27 17:12" },
				{ "25", "25", "New Zealand-English", "2009-08-16 00:26" },
				{ "26", "26", "Norway-Norwegian", "2009-08-19 10:58" },
				{ "27", "27", "Lithuania-Lithuanian", "2009-08-25 22:38" },
				{ "28", "28", "Nicaragua-Spanish", "2009-08-15 20:17" },
				{ "29", "29", "Ireland-Irish", "2009-08-14 14:30" },
				{ "30", "30", "Belgium-French", "2009-08-24 19:00" },
				{ "31", "31", "Spain-Spanish", "2009-08-23 16:44" },
				{ "32", "32", "Lebanon-Arabic", "2009-08-30 08:26" },
				{ "33", "33", "Canada-French", "2009-08-18 08:10" },
				{ "34", "34", "Estonia-Estonian", "2009-08-16 07:11" },
				{ "35", "35", "Kuwait-Arabic", "2009-08-30 18:51" },
				{ "36", "36", "Serbia-Serbian", "2009-08-09 19:43" },
				{ "37", "37", "United States-Spanish", "2009-08-29 17:33" },
				{ "38", "38", "Mexico-Spanish", "2009-08-21 09:12" },
				{ "39", "39", "Sudan-Arabic", "2009-08-18 16:52" },
				{ "40", "40", "Indonesia-Indonesian", "2009-08-10 03:11" },
				{ "41", "41", "Uruguay-Spanish", "2009-08-28 01:19" },
				{ "42", "42", "Latvia-Latvian", "2009-08-31 01:13" },
				{ "43", "43", "Brazil-Portuguese", "2009-08-11 14:03" },
				{ "44", "44", "Syria-Arabic", "2009-08-12 09:43" },
				{ "45", "45", "Dominican Republic-Spanish", "2009-08-23 13:22" },
				{ "46", "46", "Switzerland-French", "2009-08-13 21:07" },
				{ "47", "47", "India-Hindi", "2009-08-31 13:13" },
				{ "48", "48", "Venezuela-Spanish", "2009-08-24 21:06" },
				{ "49", "49", "Bahrain-Arabic", "2009-08-22 01:27" },
				{ "50", "50", "Philippines-English", "2009-08-08 18:07" },
				{ "51", "51", "Tunisia-Arabic", "2009-08-09 02:28" },
				{ "52", "52", "Austria-German", "2009-08-12 13:37" },
				{ "53", "53", "Netherlands-Dutch", "2009-08-19 12:37" },
				{ "54", "54", "Ecuador-Spanish", "2009-08-28 17:01" },
				{ "55", "55", "Taiwan-Chinese", "2009-08-17 06:41" },
				{ "56", "56", "Jordan-Arabic", "2009-08-17 11:19" },
				{ "57", "57", "Iceland-Icelandic", "2009-08-13 03:55" },
				{ "58", "58", "Colombia-Spanish", "2009-08-13 08:05" },
				{ "59", "59", "Costa Rica-Spanish", "2009-08-11 14:07" },
				{ "60", "60", "Chile-Spanish", "2009-08-11 10:57" },
				{ "61", "61", "Egypt-Arabic", "2009-08-20 08:36" },
				{ "62", "62", "South Africa-English", "2009-08-09 05:38" },
				{ "63", "63", "Thailand-Thai", "2009-08-20 10:29" },
				{ "64", "64", "Greece-Greek", "2009-08-10 03:08" },
				{ "65", "65", "Italy-Italian", "2009-08-07 17:09" },
				{ "66", "66", "Hungary-Hungarian", "2009-08-22 06:45" },
				{ "67", "67", "Ireland-English", "2009-08-10 10:12" },
				{ "68", "68", "Ukraine-Ukrainian", "2009-08-16 23:14" },
				{ "69", "69", "Poland-Polish", "2009-08-11 08:13" },
				{ "70", "70", "Luxembourg-French", "2009-08-19 21:33" },
				{ "71", "71", "Belgium-Dutch", "2009-08-12 10:56" },
				{ "72", "72", "India-English", "2009-08-22 09:57" },
				{ "73", "73", "Spain-Catalan", "2009-08-28 07:09" },
				{ "74", "74", "Morocco-Arabic", "2009-08-30 05:38" },
				{ "75", "75", "Bolivia-Spanish", "2009-08-17 12:35" },
				{ "76", "76", "Australia-English", "2009-08-09 19:22" },
				{ "77", "77", "Singapore-Chinese", "2009-08-16 00:43" },
				{ "78", "78", "El Salvador-Spanish", "2009-08-12 06:51" },
				{ "79", "79", "Russia-Russian", "2009-09-01 09:22" },
				{ "80", "80", "South Korea-Korean", "2009-08-20 16:05" },
				{ "81", "81", "Algeria-Arabic", "2009-08-10 12:34" },
				{ "82", "82", "Vietnam-Vietnamese", "2009-08-31 11:44" },
				{ "83", "83", "Montenegro-Serbian", "2009-08-24 19:10" },
				{ "84", "84", "Libya-Arabic", "2009-08-19 12:06" },
				{ "85", "85", "China-Chinese", "2009-08-24 16:43" },
				{ "86", "86", "Belarus-Belarusian", "2009-08-20 08:51" },
				{ "87", "87", "Hong Kong-Chinese", "2009-08-11 20:16" },
				{ "88", "88", "Israel-Hebrew", "2009-08-27 13:58" },
				{ "89", "89", "Bulgaria-Bulgarian", "2009-08-30 05:20" },
				{ "90", "90", "Malta-Maltese", "2009-08-19 14:12" },
				{ "91", "91", "Paraguay-Spanish", "2009-08-27 18:56" },
				{ "92", "92", "France-French", "2009-08-07 15:00" },
				{ "93", "93", "Czech Republic-Czech", "2009-08-24 06:20" },
				{ "94", "94", "Switzerland-Italian", "2009-08-22 17:21" },
				{ "95", "95", "Romania-Romanian", "2009-08-24 21:44" },
				{ "96", "96", "Puerto Rico-Spanish", "2009-08-22 02:46" },
				{ "97", "97", "Canada-English", "2009-08-26 14:55" },
				{ "98", "98", "Germany-German", "2009-08-24 19:20" },
				{ "99", "99", "Luxembourg-German", "2009-08-11 11:30" },
				{ "100", "100", "Argentina-Spanish", "2009-08-23 12:08" },
				{ "101", "101", "Malaysia-Malay", "2009-08-09 12:11" },
				{ "102", "102", "Croatia-Croatian", "2009-08-10 15:30" },
				{ "103", "103", "Singapore-English", "2009-08-26 06:37" },
				{ "104", "104", "Oman-Arabic", "2009-08-08 10:38" },
				{ "105", "105", "Thailand-Thai", "2009-08-28 22:47" },
				{ "106", "106", "Sweden-Swedish", "2009-08-28 01:53" },
				{ "107", "107", "Denmark-Danish", "2009-08-26 15:17" },
				{ "108", "108", "Honduras-Spanish", "2009-08-18 02:51" }

		};
	}

	private synchronized void pauseShort() {
		try {
			wait(200);
		} catch (InterruptedException ex) {
			// Dont worry about that exception
		}
	}

	private synchronized void pauseMedium() {
		try {
			wait(1000);
		} catch (InterruptedException ex) {
			// Dont worry about that exception
		}
	}

	private synchronized void pauseLong() {
		try {
			wait(4000);
		} catch (InterruptedException ex) {
			// Dont worry about that exception
		}
	}

}
